/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dgo.misc;
import java.util.Hashtable;
import starruby.Texture;

/**
 *
 * @author Daigo
 */
public class TextureManager {
  private String _root;
  private Hashtable _textures;
  public TextureManager(){
    _textures = new Hashtable();
  }
  
  public void clearTextureCache(){
    _textures.clear();
  }
  
  public Texture getTexture(String path){
    //path = _root + "/" + path + ".png";
    if(!_textures.contains(path)){
        _textures.put(path, Texture.load(path));
    }
    return (Texture)(_textures.get(path));
  }
    
}
